/**
 * \file tuple.h
 * \brief Functions with dealing with tuples (a kind of RValue).
 **/

#ifndef R_TUPLE_H
#define R_TUPLE_H

/* For every type, ensure "value.h" is loaded first. */
#include "value.h"

/**
 * \brief Create a new RValue representing a tuple, of given size, and
 * pointing to values array of RValues. This allows one to construct a
 * tuple with the array of RValues on the stack.
 **/
#define r_tuple_new(size, values) ((RValue) { \
                                         {.type = R_VALUE_TUPLE + size}, \
                                         {.val_tuple = values} })

/**
 * \brief Get the size of a tuple RValue. This could be crazy if value is
 * not a tuple. Check first!
 **/
#define r_tuple_size(value)  (value.type - R_VALUE_TUPLE)

#endif /* R_TUPLE_H */
